<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="dist/vue.js"></script>
</head>

<body>
    <div id ="app"> 
        {{ sex | sexFilter }}

        {{0 | sexFilter}}
    </div>

    <script>
    
   
     var app = new Vue({
        el: '#app',
        data: {
            sex: 1
        },
        filters: {
            'sexFilter': (val) => {
                return val === 1 ? '男' : '女';
            }
        }
        // filters: {
        //     'sexFilter': val => val === 1 ?' 男': '女'
        // }
        
     });
    </script>
</body>

</html>